#ifndef GRAPH_H
#define GRAPH_H

#define MAX_VERTICES 100

// 邻接表节点
typedef struct AdjNode {
    int vertex;
    struct AdjNode* next;
} AdjNode;

// 图结构体
typedef struct {
    int numVertices;
    AdjNode* adjList[MAX_VERTICES];
} Graph;

// 图操作API
void graph_init(Graph* g, int numVertices);
void graph_add_edge(Graph* g, int src, int dest, int undirected);
void graph_free(Graph* g);

// BFS/DFS
void graph_bfs(Graph* g, int startVertex, void (*visit)(int));
void graph_dfs(Graph* g, int startVertex, void (*visit)(int));

#endif // GRAPH_H 